package com.kevin.es.user;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;

/**
 * @author Kevin Liu
 * @date 2020/8/3 下午7:53
 */
@Data
@Document(indexName = "user",shards = 5,replicas = 0)
@AllArgsConstructor
@NoArgsConstructor
public class User implements Serializable {

    @Id
    private String id;

    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String name;

    @Field(type = FieldType.Long)
    private Integer age;

    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String desc;



}
